package service

import (
	"gitee.com/legend9999/publisher/dao"
	"gitee.com/legend9999/publisher/modle"
)

type BookService int

var bookDAO dao.BookDAO

func (b *BookService) Create(user *modle.User, book *modle.Book) error {
	return bookDAO.Create(user.ID, book)
}
func (b *BookService) Update(book *modle.Book) error {
	return bookDAO.Update(book)
}
func (b *BookService) Query(id int64) (*modle.Book, error) {
	return bookDAO.Query(id)
}
func (b *BookService) Delete(id int64) error {
	return bookDAO.Delete(id)
}
func (b *BookService) Page(page *dao.Page, book *modle.Book) error {
	return bookDAO.Page(page, book)
}
func (b *BookService) All() ([]modle.Book, error) {
	return bookDAO.All()
}
